import request from '@/utils/request'

const api = {
  getWarehousePagepUrl: '/base_warehouse/get_warehouse_page',
  getWarehouseListUrl: '/base_warehouse/get_warehouse_list',
  addWarehouseUrl: '/base_warehouse/add_warehouse',
  updateWarehouseUrl: '/base_warehouse/update_warehouse',
  removeWarehouseUrl: '/base_warehouse/remove_warehouse',
}

export async function getWarehousePagepApi(params: Map<string, any>) {
  const res = await request({
    url: api.getWarehousePagepUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getWarehouseListApi(params: Map<string, any>) {
  const res = await request({
    url: api.getWarehouseListUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function addWarehouseApi(params: Map<string, any>) {
  const res = await request({
    url: api.addWarehouseUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function updateWarehouseApi(params: Map<string, any>) {
  const res = await request({
    url: api.updateWarehouseUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function removeWarehouseApi(params: Map<string, any>) {
  const res = await request({
    url: api.removeWarehouseUrl,
    method: 'get',
    params: params,
  })
  return res
}
